Skip to content

feat: change to prototype functions for row features#1

Open
puehringer wants to merge 4 commits into
mainfrom
performance
Open

feat: change to prototype functions for row features#1
puehringer wants to merge 4 commits into
mainfrom
performance

Conversation

@puehringer

Copy link
Copy Markdown

Drastically improve memory footprint when having many rows. See TanStack#5927 for details.

proto.subRows = [] as const

proto.getValue = function (columnId: string) {
/*

@dvmoritzschoefl dvmoritzschoefl Jun 11, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this creates a performance problem for sorting

The sorting fn will do smth like this:

  const sortingProps: Partial<NumberColumnDef<Data>> = {
    sortingFn: (rowA, rowB, columnId) => {
      const a = rowA.getValue<number | [number] | undefined>(columnId);
      const b = rowB.getValue<number | [number] | undefined>(columnId);

      const aValue = Array.isArray(a) ? a[0] : a;
      const bValue = Array.isArray(b) ? b[0] : b;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants